package com.aptech.oas.interceptor;

import java.util.Map;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class CheckLoginInterceptor extends MethodFilterInterceptor {

	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		Map<String, Object> session=invocation.getInvocationContext().getSession();
		if(session.containsKey("loginUser")&&session.get("loginUser")!=null){
			return invocation.invoke();
		}
		return Action.LOGIN;
	}

}
